﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileControl.aspx.cs" Inherits="TRPOP.CMS.Admin.FileControl"
    EnableTheming="false" Theme="" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>模板在线编辑</title>
    <script src="../../js/utils.js" type="text/javascript"></script>
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <!--codemirro start-->
    <link rel="stylesheet" href="../../js/codemirro/lib/codemirror.css" />
    <script type="text/javascript" src="../../js/codemirro/lib/codemirror.js"></script>
    <script type="text/javascript" src="../../js/codemirro/xml/xml.js"></script>
    <script type="text/javascript" src="../../js/codemirro/javascript/javascript.js"></script>
    <script type="text/javascript" src="../../js/codemirro/css/css.js"></script>
    <script type="text/javascript" src="../../js/codemirro/vbscript/vbscript.js"></script>
    <script type="text/javascript" src="../../js/codemirro/htmlmixed/htmlmixed.js"></script>
    <!--codemirro end-->
</head>
<body>
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="2" width="100%" border="0">
        <tr>
            <td>
                <cms:TextBox runat="server" ID="ContentValue" Width="790" Height="350" Rows="30"
                    Columns="500" TextMode="MultiLine"></cms:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                当前文件: &nbsp;&nbsp; <span style="color: Blue; font-weight: bold;" id="CurrentFolder">
                    <%=m_strRoot%>
                </span>&nbsp;&nbsp;<cms:Button runat="server" CssClass="button_style" Text=" 保   存 "
                    ID="btnSave" OnClick="btnSave_Click" />
            </td>
        </tr>
    </table>
    </form>
    <script type="text/javascript">
        CodeMirroreditor = null;
        var contentText = document.getElementById("ContentValue");
        var mixedMode = {
            name: "htmlmixed",
            scriptTypes: [ { matches: /\/x-handlebars-template|\/x-mustache/i, mode: null},
                           { matches: /(text|application)\/(x-)?vb(a|script)/i,mode: "vbscript"}
                          ]
            };
        <%switch (m_strsyntax)
          {
              case "html":
              case "js":
              case "css":
              case "xml":
        %>
        CodeMirroreditor = CodeMirror.fromTextArea(contentText, { mode: mixedMode, tabMode: "indent", lineNumbers: true });
        <%
              break;
          } 
         %>
         CodeMirroreditor.setSize(790, 350);
         CodeMirroreditor.refresh();
    </script>
</body>
</html>
